--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,11 +18,15 @@
 
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
+if (LIB_MODE MATCHES SHARED)
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+else()
 option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
+endif()
-option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
-option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
-option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON)
-option(GLFW_INSTALL "Generate installation target" ON)
+option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF)
+option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF)
+option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF)
+option(GLFW_INSTALL "Generate installation target" OFF)
 option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
 
 if (WIN32)
@@ -505,7 +505,7 @@
     # On Unix-like systems, shared libraries can use the soname system.
     set(GLFW_LIB_NAME glfw)
 else()
-    set(GLFW_LIB_NAME glfw3)
+    set(GLFW_LIB_NAME glfw)
 endif()
 
 #--------------------------------------------------------------------
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -57,7 +57,7 @@
     set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C)
 endif()
 
-add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
+add_library(glfw ${LIB_MODE} ${glfw_SOURCES} ${glfw_HEADERS})
 set_target_properties(glfw PROPERTIES
                       OUTPUT_NAME "${GLFW_LIB_NAME}"
                       VERSION ${GLFW_VERSION}
@@ -63,19 +63,10 @@
                       VERSION ${GLFW_VERSION}
                       SOVERSION ${GLFW_VERSION_MAJOR}
                       POSITION_INDEPENDENT_CODE ON
-                      FOLDER "GLFW3")
+)
 
 if (BUILD_SHARED_LIBS)
-    if (WIN32)
-        # The GLFW DLL needs a special compile-time macro and import library name
-        set_target_properties(glfw PROPERTIES PREFIX "" IMPORT_PREFIX "")
-
-        if (MINGW)
-            set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.a")
-        else()
-            set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib")
-        endif()
-    elseif (APPLE)
+    if (APPLE)
         # Append -fno-common to the compile flags to work around a bug in
         # Apple's GCC
         get_target_property(glfw_CFLAGS glfw COMPILE_FLAGS)
